package com.nextbusmn.server.JSONBuilders;

import java.util.Date;

import com.google.appengine.labs.repackaged.org.json.JSONException;
import com.google.appengine.labs.repackaged.org.json.JSONObject;

public class UpdateJSONBuilder {

	public static JSONObject getUpdateJSON(Date date) {
		JSONObject jobj = new JSONObject();
		
		@SuppressWarnings("deprecation")
		int dateInt = ((date.getYear() + 1900) * 10000) +
						((date.getMonth() + 1) * 100) +
						date.getDate();
		try {
			jobj.put("d", dateInt);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return jobj;
	}

}
